{
  "properties" : { },
  "id" : "ca71163130da4ea791f089ba9e69b1c2",
  "script" : null,
  "groupId" : "ded0996d4aa14841ae2d40edb1fa6d63",
  "name" : "查询设备详情",
  "createTime" : 1727071133970,
  "updateTime" : 1726044036369,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "getDevice",
  "method" : "GET",
  "parameters" : [ {
    "name" : "deviceId",
    "value" : "D6263831650352036929",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": {\n        \"id\": \"D6263831650352036929\",\n        \"deviceName\": \"阜康抽蓄电站\",\n        \"deviceAlias\": \"\",\n        \"ip\": \"60.2.7.42\",\n        \"snCode\": \"\",\n        \"assetNo\": \"\",\n        \"dccId\": \"\",\n        \"operateDate\": \"2024-09-10 15:31:01.855\",\n        \"expiryDate\": \"\",\n        \"deviceType\": 1,\n        \"deviceFirm\": \"\",\n        \"softVersion\": \"\",\n        \"deviceModelId\": \"\",\n        \"voltageLevel\": 3,\n        \"netRegion\": 1,\n        \"location\": \"\",\n        \"stationProp\": 4,\n        \"stationName\": \"\",\n        \"stationType\": 6,\n        \"dccCaliber\": \"\",\n        \"openStatus\": 1,\n        \"createTime\": \"\",\n        \"updateTime\": \"\",\n        \"mtncStatus\": 0,\n        \"accessNetwork\": 1,\n        \"groupName\": \"\",\n        \"deviceId\": \"D6263831650352036929\",\n        \"snmpVersion\": \"1\",\n        \"rocommunity\": \"SGD!@#$-XB_123\",\n        \"rwcommunity\": \"SGD!@#$-XB_123\",\n        \"portRw\": 161,\n        \"portTrap\": 162,\n        \"useagent\": \"\",\n        \"agentserver\": \"\",\n        \"managestatus\": \"\",\n        \"retryCount\": \"\",\n        \"timeout\": \"\",\n        \"securityName\": \"\",\n        \"securityLevel\": \"\",\n        \"authProtocol\": \"\",\n        \"authPassword\": \"\",\n        \"privProtocol\": \"\",\n        \"privPassword\": \"\",\n        \"proType\": \"\",\n        \"deviceUsername\": \"2133321\",\n        \"devicePassword\": \"333\",\n        \"devicePort\": 22,\n        \"sftpEnable\": \"\",\n        \"cfgCron\": \"\",\n        \"communityR\": \"SGD!@#$-XB_123\",\n        \"communityRW\": \"SGD!@#$-XB_123\"\n    }\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "status",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
  var sql = """   SELECT
            d.* ,
            dept.dept_name group_name,
            nsp.*,ndp.*,
            nsp.rocommunity community_R,
            nsp.rwcommunity community_R_W,
            model.device_firm
        FROM
            NDMP_DEVICE d
        LEFT JOIN  blade_dept dept ON dept.ID = d.dcc_id
         LEFT JOIN  ndmp_net_device_model_info model ON model.ID = d.device_model_id
        LEFT JOIN  ndmp_net_snmp_protocol nsp ON nsp.device_id = d.id
        LEFT JOIN  ndmp_net_device_protocol ndp ON ndp.device_id = d.id
   WHERE
             d.id = #{deviceId}
            """;
  var res = db.selectOne(sql);
if (res ==null){
    return null
}
  res.put("stationType", res.get("stationType")::int)
  res.put("stationProp", res.get("stationProp")::int)
  res.put("netRegion", res.get("netRegion")::int)
  res.put("accessNetwork", res.get("accessNetwork")::int)
  res.put("deviceType", res.get("deviceType")::int)
  res.put("voltageLevel", res.get("voltageLevel")::int)
  res.put("communityR", res.get("rocommunity"))
  res.put("communityRW", res.get("rwcommunity"))
  return res